﻿@model NK.Mvc3.Models.Sale

@{
    ViewBag.Title = "Details";
}

@{
    var grid = new WebGrid(source: Model.SaleDetails, rowsPerPage:5, canPage:true, canSort:true);
}

<h2>Details</h2>

<fieldset>
    <legend>Sale</legend>

    <div class="display-label">DateSale</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.DateSale)
    </div>

    <div class="display-label">StaffName</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.StaffName)
    </div>
    <div>
        @Html.ActionLink("Create Sale Detail", "Create", "SaleDetail")
    </div>
    <p>
        <div@* class="saledetails-grid"*@ >
            @grid.GetHtml(columns: grid.Columns(grid.Column(columnName: "ProductInfo.BarCode", header: "BarCode"), grid.Column(columnName: "ProductInfo.POSDescription",header:"POS Desc")
                     , grid.Column(header: "", format: (item) => new HtmlString(Html.ActionLink("Edit", "Edit", "SaleDetail", new { id = item.id }, null).ToString() + "|" + Html.ActionLink("Delete", "Delete", "SaleDetail", new { id = item.id }, null).ToString()))
                     ))
        </div>
    </p>
</fieldset>
<p>
    @Html.ActionLink("Edit", "Edit", new { id=Model.ID }) |
    @Html.ActionLink("Back to List", "Index")
</p>
